home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3894 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  945 b 

  1. Path: news.chattanooga.net!usenet
  2. From: "Eric W. Bradway" <ebradway@microsports.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: How to give functions as parameters?
  5. Date: Wed, 31 Jan 1996 13:25:53 -0500
  6. Organization: Micro Sports, Inc.
  7. Message-ID: <310FB431.19FC@microsports.com>
  8. References: <Pine.SUN.3.91N2x.960130222756.11581A-100000@yellow59.nada.kth.se>
  9. NNTP-Posting-Host: 205.244.28.38
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b5 (Win95; I)
  14.  
  15. Per Steneskog wrote:
  16. > I have a little problem, I dont know how to send a fuction,
  17. > as a parameter to another function..
  18.  
  19. Take a look at how the Standard C qsort function works...
  20.  
  21. >   do_it(do_me()); /* ERROR-COMPILE LINE */          ^ do_me is being called here - it returns a void that the
  22.             compiler thinks you want passed to do_it.
  23.  
  24. Try do_it(do_me);  // and for more fun rename do_me to to_me!
  25.  
  26. Have fun
  27. -Eric
  28.